package 笔试;

import java.util.Arrays;
import java.util.Scanner;

public class 滴滴_假期作业 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int k = scan.nextInt();

        scan.nextLine();
        int[][] p = new int[k][4];
        for (int i = 0; i < k; i++) {
            for (int j = 0; j < 4; j++) {
                p[i][j] = scan.nextInt();
            }
            scan.nextLine();
        }

        Arrays.sort(p);

        int count = 0;
        int tmp = 1;
        for (int i = 0; i < n; i++) {
            
        }

        System.out.println(count);
    }
}
